diff options
Diffstat (limited to 'app/[lng]/partners/(partners)/rfq-ship/[id]/page.tsx')
| -rw-r--r-- | app/[lng]/partners/(partners)/rfq-ship/[id]/page.tsx | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/app/[lng]/partners/(partners)/rfq-ship/[id]/page.tsx b/app/[lng]/partners/(partners)/rfq-ship/[id]/page.tsx deleted file mode 100644 index 5b52e4a4..00000000 --- a/app/[lng]/partners/(partners)/rfq-ship/[id]/page.tsx +++ /dev/null @@ -1,81 +0,0 @@ -// app/vendor/quotations/[id]/page.tsx - 견적 응답 페이지 -import { Metadata } from "next" -import { notFound } from "next/navigation" -import db from "@/db/db"; -import { eq } from "drizzle-orm" -import { procurementVendorQuotations } from "@/db/schema" -import { getServerSession } from "next-auth/next" -import { authOptions } from "@/app/api/auth/[...nextauth]/route" -import VendorQuotationEditor from "@/lib/procurement-rfqs/vendor-response/quotation-editor"; - - -interface PageProps { - params: Promise<{ - id: string - }> -} - -export async function generateMetadata(props: PageProps): Promise<Metadata> { - return { - title: "견적서 응답", - description: "RFQ에 대한 견적서 작성 및 제출", - } -} - -export default async function VendorQuotationPage(props: PageProps) { - const params = await props.params - const quotationId = parseInt(params.id) - - if (isNaN(quotationId)) { - notFound() - } - - // 인증 확인 - const session = await getServerSession(authOptions); - - if (!session?.user) { - return ( - <div className="flex h-full items-center justify-center"> - <div className="text-center"> - <h2 className="text-xl font-bold">로그인이 필요합니다</h2> - <p className="mt-2 text-muted-foreground">견적서 응답을 위해 로그인해주세요.</p> - </div> - </div> - ) - } - - // 견적서 정보 가져오기 - const quotation = await db.query.procurementVendorQuotations.findFirst({ - where: eq(procurementVendorQuotations.id, quotationId), - with: { - rfq: true, // 관계 설정 필요 - vendor: true, // 관계 설정 필요 - items: true, // 관계 설정 필요 - } - }) - - if (!quotation) { - notFound() - } - - // 벤더 권한 확인 (필요한 경우) - const isAuthorized = session.user.domain === "partners" && - session.user.companyId === quotation.vendorId - - if (!isAuthorized) { - return ( - <div className="flex h-full items-center justify-center"> - <div className="text-center"> - <h2 className="text-xl font-bold">접근 권한이 없습니다</h2> - <p className="mt-2 text-muted-foreground">이 견적서에 대한 권한이 없습니다.</p> - </div> - </div> - ) - } - - return ( - <div className="container py-8"> - <VendorQuotationEditor quotation={quotation} /> - </div> - ) -}
\ No newline at end of file |
